// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 查询所有角色 查询所有角色数据 GET /sys/role/ */
export async function sysRoleControllerListNoLimit(options?: { [key: string]: any }) {
  return request<API.SysRole[]>(`${apiPrefix}/sys/role/`, {
    method: 'GET',
    ...(options || {}),
  });
}

/** 新增角色 新增角色 POST /sys/role/add */
export async function sysRoleControllerAddRole(
  body: API.SysRoleReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/sys/role/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量操作 批量操作 POST /sys/role/batch */
export async function sysRoleControllerBatch(
  body: API.BatchOperatorReq,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/role/batch`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 导出文件 导出文件 GET /sys/role/download/excel */
export async function sysRoleControllerDownloadExcel(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysRoleControllerDownloadExcelParams,
  options?: { [key: string]: any },
) {
  return request<any>(`${apiPrefix}/sys/role/download/excel`, {
    method: 'GET',
    params: {
      ...params,
      search: undefined,
      ...params['search'],
    },
    ...(options || {}),
  });
}

/** 编辑角色 编辑角色 POST /sys/role/edit */
export async function sysRoleControllerEditRole(
  body: API.SysRoleReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/sys/role/edit`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 系统自增角色编码 系统自增角色编码 GET /sys/role/increment */
export async function sysRoleControllerNextRoleNo(options?: { [key: string]: any }) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/role/increment`, {
    method: 'GET',
    ...(options || {}),
  });
}

/** 分页查询 分页查询数据 GET /sys/role/list */
export async function sysRoleControllerList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysRoleControllerListParams,
  options?: { [key: string]: any },
) {
  return request<API.Pagination>(`${apiPrefix}/sys/role/list`, {
    method: 'GET',
    params: {
      ...params,
      search: undefined,
      ...params['search'],
      page: undefined,
      ...params['page'],
    },
    ...(options || {}),
  });
}

/** 保存角色菜单 保存角色菜单 POST /sys/role/menu/edit */
export async function sysRoleControllerSaveRoleMenus(
  body: API.SysRoleMenuReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/sys/role/menu/edit`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取角色菜单信息 GET /sys/role/menus */
export async function sysRoleControllerGetRoleMenus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysRoleControllerGetRoleMenusParams,
  options?: { [key: string]: any },
) {
  return request<API.SysMenu[]>(`${apiPrefix}/sys/role/menus`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 删除角色 删除单条记录 DELETE /sys/role/remove/${param0} */
export async function sysRoleControllerRemove(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysRoleControllerRemoveParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/role/remove/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 编辑角色状态 编辑角色状态 PUT /sys/role/save/status */
export async function sysRoleControllerSaveRoleStatus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysRoleControllerSaveRoleStatusParams,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/sys/role/save/status`, {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 导入文件 导入文件数据 POST /sys/role/upload/excel */
export async function sysRoleControllerUploadExcel(body: {}, options?: { [key: string]: any }) {
  return request<API.ApiResultVoid>(`${apiPrefix}/sys/role/upload/excel`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
